home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / bigtol1g / form1.frm next >
Text File  |  1999-08-22  |  3KB  |  97 lines

  1. VERSION 5.00
  2. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
  3. Begin VB.Form Form1 
  4.    Caption         =   "Note Pad"
  5.    ClientHeight    =   3195
  6.    ClientLeft      =   165
  7.    ClientTop       =   735
  8.    ClientWidth     =   4920
  9.    LinkTopic       =   "Form1"
  10.    ScaleHeight     =   3195
  11.    ScaleWidth      =   4920
  12.    StartUpPosition =   3  'Windows Default
  13.    Begin VB.TextBox Text1 
  14.       Appearance      =   0  'Flat
  15.       BeginProperty Font 
  16.          Name            =   "Courier New"
  17.          Size            =   8.25
  18.          Charset         =   0
  19.          Weight          =   400
  20.          Underline       =   0   'False
  21.          Italic          =   0   'False
  22.          Strikethrough   =   0   'False
  23.       EndProperty
  24.       Height          =   1935
  25.       Left            =   240
  26.       MultiLine       =   -1  'True
  27.       ScrollBars      =   3  'Both
  28.       TabIndex        =   0
  29.       Text            =   "Form1.frx":0000
  30.       Top             =   480
  31.       Width           =   2775
  32.    End
  33.    Begin MSComDlg.CommonDialog CommonDialog1 
  34.       Left            =   3480
  35.       Top             =   360
  36.       _ExtentX        =   847
  37.       _ExtentY        =   847
  38.       _Version        =   393216
  39.       Filter          =   "*.txt"
  40.       FilterIndex     =   1
  41.    End
  42.    Begin VB.Menu mnuFile 
  43.       Caption         =   "File"
  44.       Begin VB.Menu mnuNew 
  45.          Caption         =   "New"
  46.       End
  47.       Begin VB.Menu mnuOpen 
  48.          Caption         =   "Open"
  49.       End
  50.       Begin VB.Menu mnuSave 
  51.          Caption         =   "Save"
  52.       End
  53.       Begin VB.Menu mnuExit 
  54.          Caption         =   "Exit"
  55.       End
  56.    End
  57. End
  58. Attribute VB_Name = "Form1"
  59. Attribute VB_GlobalNameSpace = False
  60. Attribute VB_Creatable = False
  61. Attribute VB_PredeclaredId = True
  62. Attribute VB_Exposed = False
  63. Dim fso As FileSystemObject
  64. Dim fs As TextStream
  65.  
  66. Private Sub Form_Load()
  67. Set fso = CreateObject("Scripting.FileSystemObject")
  68. End Sub
  69.  
  70. Private Sub Form_Resize()
  71. If Me.WindowState = vbMinimized Then Exit Sub
  72. Text1.Left = 50
  73. Text1.Top = 50
  74. Text1.Width = Form1.Width - 200
  75. Text1.Height = Form1.Height - 770
  76. End Sub
  77.  
  78. Private Sub mnuExit_Click()
  79. End
  80. End Sub
  81.  
  82. Private Sub mnuNew_Click()
  83. Text1.Text = ""
  84. End Sub
  85.  
  86. Private Sub mnuOpen_Click()
  87. CommonDialog1.ShowOpen
  88. Set fs = fso.OpenTextFile(CommonDialog1.FileName, ForReading)
  89. Text1.Text = fs.ReadAll
  90. End Sub
  91.  
  92. Private Sub mnuSave_Click()
  93. CommonDialog1.ShowSave
  94. Set fs = fso.CreateTextFile(CommonDialog1.FileName, ForWriting)
  95. fs.Write Text1.Text
  96. End Sub
  97.